#pragma once


#include "Arduino.h"
#include <Wire.h>



class Sensor {
  public:
    uint8_t err;
    //Default constructor
    Sensor(void);

    //Function for getting specific bits in register
    //this function will only read bit range from msb to lsb, the returned value will be zero-padded
    uint8_t getRegValue(uint8_t deviceAddress, uint8_t reg, uint8_t msb = 7, uint8_t lsb = 0) ;
    //Function for setting specific bits in register
    //this function will only change bit range from msb to lsb
    uint8_t setRegValue(uint8_t deviceAddress, uint8_t reg, uint8_t value, uint8_t msb = 7, uint8_t lsb = 0) ;

    //Function for reading from several consecutive registers
    uint8_t* readRegisterBurst(uint8_t deviceAddress, uint8_t reg, uint8_t len) ;
    //Function for reading from a single register
    //this is a low-level function, use getRegValue instead!
    uint8_t readRegister(uint8_t deviceAddress, uint8_t reg) ;
    //Function for writing to a single register
    //this is a low-level function, use setRegValue instead!
    void writeRegister(uint8_t deviceAddress, uint8_t reg, uint8_t data) ;
};
